<div class="bg_greenyellow round_10 quarter shadow_in_0">
    <ul class="rightmenu">
        <li><a href="<?php echo $this->url(array('controller' => 'mymca', 'action' => 'index'), null, true) ?>" >Powrót</a></li>
    </ul>    
</div>
    
    
<div class="threequarter vpad_10 last fixed">
    
    <?php 
     
    ?>

    
    <h6 class ="bg_mediumblue round_5 shadow_out_4">Okresy dostaw</h6>
    <br />
    
    <? if(empty($this->periods)){ ?>
    
        <div class="warning"><p>Nie zdefiniowałeś jeszcze żadnego okresu dostaw!</p><div></div></div>
            
    <? } else { ?>
    <table class="plain" width="100%">
       <caption>
          Okresy dostaw
       </caption>
       <thead>
          <tr>

             <th style="width:5%" scope="col">Nazwa</th>
             <th style="width:5%"scope="col">Typ</th>
             <th style="width:30%"scope="col">Od </th>
             <th style="width:30%"scope="col">Do</th>
             <th style="width:15%"scope="col"></th>
             <th style="width:15%"scope="col"></th>
          </tr>
       </thead>
       <tfoot>
          <tr>

             <th>&nbsp;</th>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
          </tr>
       </tfoot>
       <?php foreach ($this->periods as $period){ ?>
       <tbody>
          <tr>
             <th scope="row"><?php echo $period->getName();?></th>
             <td ><?php 
             if($period->getPeriodType()=='userDefined'){
                 echo 'U';
             } else {
                 echo 'G';
             }
             ?></td>

             <td><?php echo $this->dateToString($period->getStartTime()); ?></td>
             <td><?php echo $this->dateToString($period->getEndTime());?></td>
             <? if($period->getPeriodType()=='userDefined'){ ?>
             <td>
                 <a class="edit_button grey styled_button" href='<?php echo $this->url(array('action'=>'edit-period','controller'=>'mymca','id'=>$period->getCalendarPeriod_id()),null,true); ?>'>Edytuj</a>
             </td>
             <td>
                 <a class="delete_button grey styled_button" href='<?php echo $this->url(array('action'=>'delete-period','controller'=>'mymca','id'=>$period->getCalendarPeriod_id()),null,true); ?>'>Usuń</a>
             </td>
             <? } else {?>
             <td style="height: 25px"></td>
             <td></td>
             <? }?>
          </tr> 
      <? } ?>
       </tbody>
    </table>
    <?  } ?>
    
    <br /> 
    
    <h6 class ="bg_mediumblue round_5 shadow_out_4">Dodaj nowy okres dostaw</h6>
    <?php echo $this->form; ?>
    
    <br />
    * Format DD/MM/RRRR
</div>   